﻿using AdminBase.Model.Entitys;
using Newtonsoft.Json;
using SqlSugar;

namespace AdminBase.Model
{
    /// <summary>
    /// 部门模型类
    /// </summary>
    public class DepartmentsDto : Departments
    {
        /// <summary>
        /// 重写ID赋值tree特性
        /// </summary>
        [SugarColumn(IsTreeKey = true)]
        [JsonProperty("id")]
        public long ID { get; set; }

        /// <summary>
        /// 文本
        /// </summary>
        public string Label => base.Name;

        /// <summary>
        /// 子级
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<DepartmentsDto>? Children { get; set; }
    }
}
